package com.kogi.androidpatt.gettingInput;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import android.view.View;
import android.widget.ExpandableListView;
import com.kogi.patterns.R;


public class mainListGettingInput extends Activity
{
	
	boolean click = true;
	expandableListAdapterGettingInput adapter;
	private Intent sliderIntent,spinnerIntent,checkboxIntent,plusMinusIntent,panAndScan,extract,con;
	
	 @Override
	 public void onCreate(Bundle savedInstanceState) 
	 {
	        super.onCreate(savedInstanceState);
	        setContentView(R.layout.getting_input_list);
	        
	        Activity a = this; 
	        ExpandableListView epView = (ExpandableListView) findViewById(R.id.expandableListGettingInput);
	        adapter = new expandableListAdapterGettingInput(a);
	        epView.setAdapter(adapter);
	        con = new Intent(this, com.kogi.patterns.dummy.class);
	        sliderIntent = new Intent(this,com.kogi.androidpatt.gettingInput.enterValue.Slider.class);
	        spinnerIntent = new Intent(this,com.kogi.androidpatt.gettingInput.enterValue.spinner.class);
	        checkboxIntent = new Intent(this,com.kogi.androidpatt.gettingInput.multipleItems.checkbox.class);
	        plusMinusIntent = new Intent(this,com.kogi.androidpatt.gettingInput.timeAndDate.plusMinus.class);
	        panAndScan = new Intent(this,com.kogi.androidpatt.gettingInput.enterText.panAndScan.class);
	        extract = new Intent(this,com.kogi.androidpatt.gettingInput.enterText.extract.class);
	        epView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() 
	        {	            
				@Override
				public boolean onChildClick(ExpandableListView arg0, View arg1,int arg2, int arg3, long arg4) 
				{
					
					if(arg2==0 && arg3==0)
					{
						startActivity(sliderIntent);
					}
					else if(arg2==0 && arg3==1)
					{
						startActivity(spinnerIntent);
					}
					else if(arg2==1 && arg3==0)
					{
						startActivity(panAndScan);
					}
					else if(arg2==1 && arg3==1)
					{
						startActivity(extract);
					}
					else if(arg2==2 && arg3==0)
					{
						startActivity(spinnerIntent);
					}
					else if(arg2==3 && arg3==0)
					{
						startActivity(checkboxIntent);
					}
					else if (arg2==4 && arg3==0)
					{
						startActivity(plusMinusIntent);
					}
					else if (arg2==4 && arg3==1)
					{
						startActivity(con);
					}
					return false;
				}
	        }); 	      
	 }
	 
	 
}

